package com.jdb.versailles.service.impl;

//imports..
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jdb.versailles.dao.ClientDao;
import com.jdb.versailles.model.Client;
import com.jdb.versailles.service.ClientService;
 

@Service("clientService")
public class ClientServiceImpl implements ClientService{
  
  @Autowired 
  private ClientDao clientDao;
  
  public void setClientDao(ClientDao clientDao){
	  this.clientDao=clientDao;
  }
   
  /**
   * @Transactional annotation below will trigger Spring Hibernate transaction manager to automatically create
   * a hibernate session. See src/main/webapp/WEB-INF/servlet-context.xml
   */
  
  @Transactional
  public void saveClient(Client client) {
	  clientDao.saveClient(client);  	
  }
  
  @Transactional
  public List<Client> findAll() {
	 return clientDao.findAll();
  }


}